Suspension Frames on the WAM Heap

نویسندگان

  • Bart Demoen
  • Phuong-Lan Nguyen
چکیده

A suspension encapsulates everything needed to execute a piece of code many times in the same context: the need for this feature exists in constraint solver programming, where (part of) a predicate checking the satisfiability of a set of a constraints needs to be re-executed every time the domain of a concerned variable changes. Traditional extensions of the WAM support a heap term and metacall based approach to this issue. The most efficient implementation of suspensions in the context of Prolog exists in B-Prolog. B-Prolog is based on the TOAM and suspension frames are put in the execution stack. They are notorioulsy cheap to re-enter. It is clear that the WAM could be adapted to allow suspension frames on the local stack. However, it is worth exploring a scheme that puts suspension frames on the WAM global stack (the heap). We describe in detail the few additions to a traditional WAM system to achieve this. Together with attributed variables that is enough to compile B-Prolog’s Action Rules to almost plain Prolog. We have enhanced hProlog with the required features to support suspension frames on the heap. We compare the performance of our Action Rules implementation with B-Prolog on a set of benchmarks previously used by the author of Action Rules. Suspension Frames on the WAM Heap Bart Demoen and Phuong-Lan Nguyen ∗ Department of Computer Science, K.U.Leuven, Belgium

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Delay in the WAM and the TOAM: redoing a ten year old experiment

A 10 year old experiment related to freeze/2 and its implementation in B-Prolog and SICStus Prolog is redone. B-Prolog uses the TOAM abstract machine and its implementation of delayed goals is by means of suspension frames on the execution stack. The traditional WAM approach partly established by SICStus Prolog implementors is to put suspension terms on the heap. Earlier experiments comparing t...

متن کامل

A Novel Implementation Method of Delay

The e ciency of delay depends to a large extent on the following four basic operations: delay, wakeup, interrupt, and resume. Traditional implementations of delay in the WAM are slow because three out of the four basic operations need to save or restore the argument registers. In this paper, we present a novel method for implementing delay in a Prolog machine called ATOAM. The main idea is to s...

متن کامل

Heap Memory Management in Prolog with Tabling: Principles and Practice

We address memory management aspects of WAM-based logic programming systems that support tabled evaluation through the use of a suspension/resumption mechanism. We describe the memory organization and usefulness logic of such systems, and issues that have to be resolved for effective and efficient garbage collection. Special attention is given to early reset in the context of suspended computat...

متن کامل

Incremental copying garbage collection for WAM-based Prolog systems

We present an incremental copying garbage collector for the heap in WAM-based Prolog systems. We describe a heap layout in which the heap is divided in a number of equal-sized blocks. Other changes to the standard WAM allow to garbage collect these blocks independently from each other. Independent collection of heap blocks is the basis of our incremental algorithm. Compared to other copying col...

متن کامل

Heap Garbage Collection in XSB: Practice and Experience

Starting from a theoretical understanding of the issues involved in the implementation of a heap garbage collector in a logic programming system with built-in tabling, and from an actual collector that did not take tabling (i.e. suspended computations) into account we have build two working heap garbage collectors (one mark&slide, one mark&copy) for XSB on top of a CHAT implementation model for...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2006